/*
 * Copyright 2015 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.treevis {
  cursor: se-resize;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.treevis-highlight {
  outline: 2000px solid rgba(0, 0, 0, 0.5);
  border: 10px solid rgba(233, 30, 99, 0.5);
  margin-left: -10px;
  margin-top: -10px;
  opacity: 1;
  position: absolute;
  z-index: 1000;
  transition: opacity 0.25s ease, left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
  pointer-events: none;
}

.treevis-highlight.noanimate {
  transition: none;
}

.treevis-highlight.inactive {
  opacity: 0;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.treevis .linearlayout {
  display: flex;
}

.treevis .linearlayout.vertical {
  flex-direction: column;
}

.treevis .linearlayout > div {
  flex-shrink: 0;
}

.treevis .flex {
  flex: 1 0 0;
}

.treevis .framelayout > div {
  position: absolute;
}

.treevis-root {
  position: relative;
  overflow: hidden;
}

/* elevations */

[data-elevation="2"] {
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
              0 3px 1px -2px rgba(0, 0, 0, 0.2),
              0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

[data-elevation="3"] {
  box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14),
              0 3px 3px -2px rgba(0, 0, 0, 0.2),
              0 1px 8px 0 rgba(0, 0, 0, 0.12);
}

[data-elevation="4"] {
  box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 
              0 1px 10px 0 rgba(0, 0, 0, 0.12),
              0 2px 4px -1px rgba(0, 0, 0, 0.2)
}

[data-elevation="6"] {
  box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14),
              0 1px 18px 0 rgba(0, 0, 0, 0.12),
              0 3px 5px -1px rgba(0, 0, 0, 0.2);
}

[data-elevation="8"] {
  box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 
              0 3px 14px 2px rgba(0, 0, 0, 0.12),
              0 5px 5px -3px rgba(0, 0, 0, 0.2)
}

[data-elevation="16"] {
  box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14),
              0  6px 30px 5px rgba(0, 0, 0, 0.12), 
              0  8px 10px -5px rgba(0, 0, 0, 0.2);
}

/* XML tree */

.xmltree {
  padding: 16px;
  z-index: 10000;
  font-family: roboto mono, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xmltree .node-meta {
  background: #333;
  color: #fff;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 2px;
  margin-top: 8px;
}

.xmltree .node.ellipsis > .node-meta {
  background: #eee;
  color: #888;
  font-family: Roboto;
}

.xmltree .has-highlight {
  cursor: pointer;
}

.xmltree .node-meta.has-highlight:hover {
  background-color: #880E4F;
}

.xmltree .node-meta.has-highlight.active {
  background: #E91E63;
}

.xmltree .node-tagname {
  font-size: 14px;
  font-weight: 700;
}

.xmltree .node-attr-name,
.xmltree .node-attr-value {
  font-size: 12px;
}

.xmltree .node-attr-name {
  color: rgba(255, 255, 255, 0.7);
  margin-right: 8px;
}

.xmltree .node-attr-value {
  color: #fff;
}

.xmltree .node-attr-name:after {
  content: ':';
}

.xmltree .node .node {
  position: relative;
  margin-left: 16px;
  padding-left: 16px;
  /*border-left: 1px dotted #ccc;*/
}

.xmltree .node .node:before {
  content: '';
  position: absolute;
  border-bottom: 1px solid #888;
  border-left: 1px solid #888;
  left: 0;
  top: 0;
  width: 16px;
  height: 32px;
  z-index: -1;
}

.xmltree .node .node:not(:last-child):after {
  content: '';
  position: absolute;
  border-left: 1px solid #888;
  left: 0;
  top: 0;
  width: 16px;
  height: 100%;
  z-index: -1;
}